package com.gzhryc.shared_device.bxscn.code.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.bxscn.code.dao.enums.PortableEnergyCabinetEnum;
import com.gzhryc.shared_device.common.device.dao.db.Device;

import java.io.Serializable;
import java.util.Date;

/**
 * 便携式能源充电柜
 * @version 2023-08-28
 */
@Table(name = "dev_portable_energy_cabinet")
public class PortableEnergyCabinet implements Serializable {

    private static final long serialVersionUID = 1L;

	@Id(auto = false)
    @Column(name = "device_sn")
    protected String deviceSn;

    @Column(name = "device_type_id")
    protected String deviceTypeId;

    @Column(name="device_type_name",note = "设备类型名称")
    protected String deviceTypeName;

    @Column(name = "slot_total", notNull = true, defVal = "1", note = "卡槽数")
    protected Integer slotTotal;

    @Column(name = "version_number", length = 64, note = "版本号")
    protected String versionNumber;

    @Column(name = "iot_type", length = 4, note = "设备IOT类型")
    protected Integer iotType;

    @Column(name = "iot_node_id", note = "连接的IOT节点ID")
    protected Long iotNodeId;

    @Column(name = "protocol_type", length = 16, notNull = true, defVal = "BXSCN_V1", note = "协议类型")
    protected String protocolType;

    @Column(name = "card_num", length = 64, note = "物联网卡号")
    protected String cardNum;

    @Column(note = "国际移动用户识别码")
    protected String imsi;

    @Column(note = "SIM卡号")
    protected String iccid;

    @Column(note = "信号强度")
    protected Integer rssi;

    @Column(notNull = true, defVal = "1", note = "设备状态")
    protected Integer state;

    @Column(name = "last_offline_date", note = "上次离线时间")
    protected Date lastOfflineDate;

    @Column(length = 128,note = "备注")
    protected String note;

    @Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
    protected Date updateDate;

    @Column(name = "create_date",notNull = true)
    protected Date createDate;

    @Join(fromField = "device_sn",toField = "device_sn")
    protected Device device;

    protected Date heartbeatData;       //心跳时间

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public String getDeviceTypeId() {
        return deviceTypeId;
    }

    public void setDeviceTypeId(String deviceTypeId) {
        this.deviceTypeId = deviceTypeId;
    }

    public String getDeviceTypeName() {
        return deviceTypeName;
    }

    public void setDeviceTypeName(String deviceTypeName) {
        this.deviceTypeName = deviceTypeName;
    }

    public Integer getSlotTotal() {
        return slotTotal;
    }

    public void setSlotTotal(Integer slotTotal) {
        this.slotTotal = slotTotal;
    }

    public String getVersionNumber() {
        return versionNumber;
    }

    public void setVersionNumber(String versionNumber) {
        this.versionNumber = versionNumber;
    }

    public Integer getIotType() {
        return iotType;
    }

    public void setIotType(Integer iotType) {
        this.iotType = iotType;
    }

    public Long getIotNodeId() {
        return iotNodeId;
    }

    public void setIotNodeId(Long iotNodeId) {
        this.iotNodeId = iotNodeId;
    }

    public String getProtocolType() {
        return protocolType;
    }

    public void setProtocolType(String protocolType) {
        this.protocolType = protocolType;
    }

    public String getCardNum() {
        return cardNum;
    }

    public void setCardNum(String cardNum) {
        this.cardNum = cardNum;
    }

    public String getImsi() {
        return imsi;
    }

    public void setImsi(String imsi) {
        this.imsi = imsi;
    }

    public String getIccid() {
        return iccid;
    }

    public void setIccid(String iccid) {
        this.iccid = iccid;
    }

    public Integer getRssi() {
        return rssi;
    }

    public void setRssi(Integer rssi) {
        this.rssi = rssi;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getLastOfflineDate() {
        return lastOfflineDate;
    }

    public void setLastOfflineDate(Date lastOfflineDate) {
        this.lastOfflineDate = lastOfflineDate;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Device getDevice() {
        return device;
    }

    public void setDevice(Device device) {
        this.device = device;
    }

    public Date getHeartbeatData() {
        return heartbeatData;
    }

    public void setHeartbeatData(Date heartbeatData) {
        this.heartbeatData = heartbeatData;
    }

    public String getStateName(){
        return PortableEnergyCabinetEnum.State.note(this.state);
    }
}
